<?php
include('rootlogin.php');
//include('../incsession.php');
session_start();


mysql_query("SET NAMES 'utf8'");
if($_POST['submit']=="back to index"){
	header("location: index.php");	
}
else if($_POST['submit']=="submit"){
	$query = "INSERT INTO class (name, teacher, year, semester) 
				VALUES ('".$_POST['name']."','".$_POST['teacher']."',".$_POST['year'].",'".$_POST['semester']."')";
	$result = mysql_query($query,$user_con);
	//echo $query;
	header("location: index.php");	
}
?>

<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="framestyle.css" type="text/css" media="screen">
<style type="text/css">

</style>
</head>


<body>

<div id="wrapper">
<div id="title">Online Listening Comprehension Program</div>

<div id="main">
<hr/>
<div id="title2">ADD A NEW CLASS</div>
<hr/>
<br><br>
<form method = POST action="new_class.php" >

<table>
<tr><td align="right">class name:<td><input type="text" name="name" class="area">
<tr><td align="right">teacher:<td><input type="text" name="teacher" class="area">
<tr><td align="right">year:<td><input type="text" name="year" class="area">
<tr><td align="right">semester:<td><select class="area" name="semester"><option value="fall">fall</option><option value="spring">spring</option></select>
</table>
<?php


?>
<br>
<div class="btn_right"><input type="submit" name = "submit" value = "submit"></div>
<br>
<div class="btn_right"><input type="submit" name = "submit" value = "back to index"></div>
</form>
</div>
</div>
</body>

